package RPC.remote;

import RPC.annotation.Remote;
import RPC.client.Response;
import RPC.pojo.User;
import RPC.service.UserService;
import RPC.utils.ResponseUtils;

import javax.annotation.Resource;
import java.util.List;

@Remote
public class UserRemoteImpl implements UserRemote{
    @Resource
    private UserService userService;

    public Response saveUser(User user){
        userService.save(user);
        return ResponseUtils.creatSuccessResult(user);
    }

    public Response saveUsers(List<User> users){

        userService.saveList(users);
        return ResponseUtils.creatSuccessResult(users);
    }
}
